﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.Validation;

namespace PraiseSystem.Domain.Entities
{
    public class User
    {
        [Required(ErrorMessage = "Please enter your ID")]
        [RegularExpression("P[0-9]{7}", ErrorMessage = "Please enter a valid ID")]
        public string UserID { get; set; }

        public virtual ICollection<Praise> Praises { get; set; }

        [Required(ErrorMessage = "Please enter your Name")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Please enter your Email")]
        [RegularExpression(".+\\@microsoft\\.com", ErrorMessage = "Please enter a valid email")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Please enter your phone")]
        [RegularExpression("[0-9]{11}", ErrorMessage = "Please enter a valid Phone")]
        public string Phone { get; set; }

        [Required(ErrorMessage = "Please enter your password")]
        public string PassWord { get; set; }

        public string ProfilePath { get; set; }
        public bool LeaveFlag { get; set; }
    }
}
